package com.ming.controller;

import com.ming.common.Result;
import com.ming.domain.BookReturn;
import com.ming.query.BookRentQuery;
import com.ming.query.BookReturnQuery;
import com.ming.service.BookReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:何元才
 * @Desc:
 * @data:2021-05-05 22:15
 */
@RestController
@RequestMapping("/bookReturn")
public class BookReturnController {

    @Autowired
    private BookReturnService bookReturnService;

    /**
     * 分页查询还书纪录
     *
     * @param query
     * @return
     */
    @RequestMapping("page.do")
    public Object page(BookReturnQuery query) {
        Result rs = bookReturnService.queryPage(query);
        return rs;
    }

    /**
     * 还书
     * @param bookReturn
     * @return
     */
    @PostMapping("return.do")
    public Object returnBook(BookReturn bookReturn) {
        Result rs = bookReturnService.returnBook(bookReturn);
        return rs;
    }


}
